<?php
   
    require_once '../include.php';
    $conexao = new Conexao();
    
    extract($_POST);
    
    $id_usuario = $_SESSION['usuario']['id'];
    
    $query = "UPDATE posicao SET inicial = 0 WHERE id_usuario = $id_usuario";
    $result = mysql_query($query);    

    $query = "UPDATE posicao SET inicial = 1 WHERE idPosicao = $idPosicao";
    $result = mysql_query($query);    
    
    $query = "SELECT idPosicao, lat, lng, zoom FROM posicao p WHERE p.id_usuario = '$id_usuario' AND inicial = 1";
    $result = mysql_query($query);

    $_SESSION['usuario']['posicaoInicial'] = mysql_fetch_array($result);
	
    //$usaMesmaConexao = true;
    
    //include("getPosicoes.php");
?>
